package com.xuyiwei.mayi.test;

/**
 * Created by xuyiwei on 2019/4/13.
 */
public class DaeonThread {
    public static void main(String[] args) {
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                for(int i=0;i<100;i++){
                    System.out.print(i);
                }
            }
        });
        //默认不是守护线程
        t.setDaemon(false);
        t.start();
        System.out.println("主线程运行结束了");
    }
}
